<template>
	<view>
		<banner />

		<view class="item" v-for="item in moviesTag" :key='item._id'>
			<view class="head">
				<text>{{item.name}}</text>
				<navigator :url="'/pages/list/list?tag='+item.name">查看更多</navigator>
			</view>
			<scroll-view scroll-x>
				<homeItem :tag='item.name'></homeItem>
			</scroll-view>

		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				moviesTag: [],
				
			}
		},
		methods: {
			getTags() {
				this.$api.home.getTags().then(({result}) => {
					this.moviesTag = result
					// console.log(result);
				})
			},
			
		},
		onLoad() {
			this.getTags();
			
		}
	}
</script>

<style lang="scss">
	.item {
		padding: 25rpx;

		.head {
			display: flex;
			justify-content: space-between;
			margin-bottom: 20rpx;

			text {
				font-weight: bold;
			}

			navigator {
				color: green;
			}
		}

		

	}
</style>
